<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/8/20
 * Time: 18:09
 */
class 四舍五入的三种方法
{

}
//1.number_format 方法实现四舍五入
$number = 1234.5678;
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,57
$english_format_number = number_format($number, 2, '.', '');
// 1234.57
//2.round方法实现四舍五入
$number = 1234.5678;
echo round($number ,2);
//1234.57
//3.sprintf 格式化输入实现四舍五入
$formatted = sprintf ("%s有￥%01.2f。",$name, $money);
echo $formatted;
//张三有￥123.10。